﻿Public Class ctrlNhanVien
    Private _NhanVien As tbNhanVien
    Property NhanVien As tbNhanVien
        Get
            Return _NhanVien
        End Get
        Set(value As tbNhanVien)
            If value Is Nothing Then Exit Property
            _NhanVien = value
            bsNhanVien.DataSource = NhanVien
        End Set
    End Property

    Private Sub btnCapNhat_Click(sender As Object, e As EventArgs) Handles btnCapNhat.Click
        dt.Refresh(Data.Linq.RefreshMode.OverwriteCurrentValues, dt.tbCuaHangs)
        bsCuaHang.DataSource = From ch In dt.tbCuaHangs Select ch Order By ch.TenCuaHang Ascending
    End Sub

    Private Sub ctrlNhanVien_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        btnCapNhat_Click(Nothing, Nothing)
    End Sub
End Class
